package company;

public class Company {
	String name, adress, tel, business;
	Staff[] st = new Staff[100];

	public boolean add(Staff sf) {
		for (int i = 0; i < st.length; i++) {
			if (st[i] == null) {
				st[i] = sf;
				return true;
			}
		}
		return false;

	}

	public boolean dis(String stName) {
		for (int i = 0; i < st.length; i++) {
			if (st[i] != null) {
				if (st[i].name.equals(stName)) {
					st[i] = null;
					for (int j = i; j < st.length - 1; j++) {
						Staff ss = st[j];
						st[j] = st[j + 1];
						st[j + 1] = ss;
					}
					return true;
				}
			}
		}
		return false;

	}

	public Staff pri(String name) {
		for (int i = 0; i < st.length; i++) {
			if (st[i] != null) {
				if (st[i].name.equals(name)) {
					return st[i];
				}
			}
		}
		return null;

	}

	public int sta() {
		int count = 0;
		for (int i = 0; i < st.length; i++) {
			if (st[i] != null) {
				count++;
			}
		}
		return count;
	}

	public void priAll() {
		for (int i = 0; i < st.length; i++) {
			if (st[i] != null) {
				st[i].show();
			}
		}
	}
}
